//
//  SearchBar.swift
//  SearchBarView
//
//  Created by liaokylin on 2024/10/12.
//

import SwiftUI

struct SearchBar: View {
    @Binding  var searchKey:String
    @Binding  var searchButton:String
    var body: some View {
        HStack{
            TextField("我在那个夏天等你",text:$searchKey)
                .padding(EdgeInsets(top: 12, leading:55, bottom: 12, trailing: 10))
                .overlay(alignment:.leading){
                    Image(systemName: "magnifyingglass").padding()
                }
          //  Text("|").foregroundColor(.gray.opacity(0.2))
            Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/, label: {
                Text(verbatim: searchButton)
            })
            .foregroundColor(.black.opacity(0.8))
            .padding()
        }
        .frame(maxWidth: UIScreen.main.bounds.width - 40,maxHeight: 40)
        .background(.gray.opacity(0.1))
        .cornerRadius(20)
       // .padding()
    }
}

